package com.situ.data;

public class RecursionDemo {
    //private static int count = 0;

    public static void main(String[] args) {
        //count++;
        //System.out.println("count: " + count);
        //main(args);


        int result = factorial(5);
        System.out.println("result: " + result);
    }

    public static int factorial(int n) {
        if (n == 1) {
            return 1;
        }

        return n * factorial(n - 1);
    }

}
